package service;

import java.util.List;

import cjgl.dao.StudentDAO;
import cjgl.entity.Course;
import cjgl.entity.Student;

public class StudentService {
      private StudentDAO studentDAO=new StudentDAO();

	public Student finById(Integer id) {
		return studentDAO.finById(id);
	}



	public List<Student> findAll() {
		return studentDAO.findAll();
	}



	public void delete(Integer id) {
		studentDAO.delete(id);
	}



	public void update(Student model) {
		studentDAO.update(model);
	}
	public void sava(Student student) {
		Integer id=student.getId();
		if(id==null) {
			studentDAO.insert(student);
		}else {
			studentDAO.update(student);
		}
		}
    public void delete(Student student) {
    	studentDAO.delete(student.getId());
    	
    
	}



    public List<Student> findByClassId(Integer id) {
		return studentDAO.findByTbClassId(id);
	}



	public Student stulogin(String username, String password) {
		return studentDAO.stulogin(username,password);
	}




}
